package org.yo.router.annotation.framework;


/**
 * @author hailong
 * @date 2021年11月05日 5:04 下午
 * <p>
 * You never know what you can do until you try !
 * ----------------------------------------------------------------
 */
public interface ApplicationAble extends Comparable<ApplicationAble> {

    void onCreate(Object context);

    void onLowMemory();

    void onTerminate();

    void onConfigurationChanged(Object config);

    default int getPriority() {
        return 100;
    }

    @Override
    default int compareTo(ApplicationAble o) {
        if (o == null) {
            return 1;
        }
        return Integer.compare(getPriority(), o.getPriority());
    }

}